home *** CD-ROM | disk | FTP | other *** search
- Path: ix.netcom.com!netnews
- From: jlilley@ix.netcom.com (John Lilley)
- Newsgroups: comp.lang.c++
- Subject: Re: Class of incomplete type - HELP
- Date: 14 Mar 1996 16:58:12 GMT
- Organization: Netcom
- Message-ID: <4i9j74$2m1@cloner3.netcom.com>
- References: <4hvgp9$8jr@crocus.csv.warwick.ac.uk>
- NNTP-Posting-Host: den-co7-20.ix.netcom.com
- Mime-Version: 1.0
- Content-Type: Text/Plain; charset=US-ASCII
- X-NETCOM-Date: Thu Mar 14 8:58:12 AM PST 1996
- X-Newsreader: WinVN 0.99.7
-
- In article <4hvgp9$8jr@crocus.csv.warwick.ac.uk>, esuqf@csv.warwick.ac.uk
- says...
- >I've got a problem for an assignment ...
- >
- >class List {
- >}
- >
- >class alphabet {
- >public:
- >char plain (char cipherin) {}
- >}
- >
- >class Blackboard {
- >public:
- > Boolean isSolved() {
- > char cipherletter = current->letter // Character node of linked list
- > if ( plain(cipherletter) == '*' )
- > return False;
- > }
- >}
- >
- >
- >1. I compile using: g++ list.C alphabet.C blackboard.C
- >
- > Error message:
- > blackboard.C: In method `enum Boolean Blackboard::isSolved()':
- > blackboard.C:70: warning: implicit declaration of function `int
- plain(...)'
-
- plain() is a member of class alphabet and must be called through
- an object of type alphabet. It is not a function. The compiler
- assumed that you were trying to call an undeclared function, which
- it defulta to a return type of 'int'.
-
- >2. I tried to inherit the alphabet class in the Blackboard class,
- > thinking that the code would work if char plain(..) becomes a
- > member function of Blackboard, I get the following:
- >
- > class Blackboard: public alphabet {
- > ..............
- > }
- > blackboard.H:4: base class `alphabet' has incomplete type
- > What does incomplete type mean?
-
- It means that the class declaration for alphabet has not been completed.
- This is typically found when you type:
- class alphabet;
- class Blackboard : public alphabet {};
- Since you are not doing that, I would get out the (apparently)
- missing semicolons that must follow the closing brace of the
- class declaration, which may be confusing the compiler into thinking
- that the first class declaration has not been completed.
-
- john lilley
-
-